import request from '@/utils/request'

// 创建班组
export function createTeam(data) {
  return request({
    url: '/basic/team/create',
    method: 'post',
    data: data
  })
}

// 更新班组
export function updateTeam(data) {
  return request({
    url: '/basic/team/update',
    method: 'put',
    data: data
  })
}

// 删除班组
export function deleteTeam(id) {
  return request({
    url: '/basic/team/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除班组 */
export function deleteTeamList(ids) {
  return request({
    url: `/basic/team/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得班组
export function getTeam(id) {
  return request({
    url: '/basic/team/get?id=' + id,
    method: 'get'
  })
}

// 获得班组分页
export function getTeamPage(params) {
  return request({
    url: '/basic/team/page',
    method: 'get',
    params
  })
}
// 导出班组 Excel
export function exportTeamExcel(params) {
  return request({
    url: '/basic/team/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}